﻿<%@ Page Title="Pedido" Language="C#" MasterPageFile="~/SiteCadastro.Master" AutoEventWireup="true" CodeBehind="PedidoView.aspx.cs" Inherits="ASPPanificadora.Telas.PedidoView" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="form" runat="server">
    <h1>Pedido</h1>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
    <br />
    <p>
        <asp:Label Text="Código:" runat="server" Width="300"/>
        <asp:TextBox ID="txtCodigo" runat="server" Width="300"  CssClass="textBox" 
            Enabled="False">0</asp:TextBox>
    </p>
    <p>
        <asp:Label Text="Fornecedor:" runat="server" Width="300"/>
        <asp:DropDownList ID="drdListaFornecedor" runat="server" Width="300"/>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="drdListaFornecedor" ErrorMessage="*Obrigatório" ForeColor="Red" InitialValue="0" />
    </p>
    <p>
        <asp:Label Text="Produto:" runat="server" Width="300"/>
        <asp:DropDownList ID="drdListaProduto" runat="server" Width="300"/>
    </p>
    <p>
        <asp:Label Text="Data Prevista" runat="server" Width="300"/>
        <asp:TextBox ID="txtDataPrevista" runat="server" Width="300" CssClass="textBox" />
        <cc1:CalendarExtender ID="CalDataPrevista" runat="server" TargetControlID="txtDataPrevista" Animated="true" Format="d/M/yyyy" />
        <cc1:MaskedEditExtender ID="MskDataPrevista" runat="server" 
            TargetControlID="txtDataPrevista" InputDirection="LeftToRight" 
            ClearMaskOnLostFocus="False" MaskType="Date" Mask="99/99/9999" 
            UserDateFormat="DayMonthYear" CultureName="pt-BR"/>
    </p>
    <p>
        <asp:Label Text="Qtde" runat="server" Width="300"/>
        <asp:TextBox ID="txtQtde" runat="server" Width="220" CssClass="textBox" 
            CausesValidation="True" ValidationGroup="Produto" />        
        <asp:Button ID="btnAdicionar" runat="server" Text="Adicionar" 
            onclick="btnAdicionar_Click" ValidationGroup="Produto" />
    </p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="grid" runat="server">
        <asp:UpdatePanel ID="udpItemPedido" runat="server">
            <ContentTemplate>
                <asp:DataList ID="dtlItemPedido" runat="server">
                    <HeaderTemplate>
                        <table cellpadding="0" border="1">
                            <tr>
                                <th>Produto</th>
                                <th>Qtde</th>
                                <th>Data Prevista Entrega</th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td><%# Eval("Produto")%></td>
                            <td><%# Eval("Qtde").ToString() %></td>
                            <td><%# Eval("DataPrevista", "{0:d}")%></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate></table></FooterTemplate>
                </asp:DataList>
            </ContentTemplate>
        </asp:UpdatePanel>
</asp:Content>
